<template>
  <div class="single container" v-wechat-title="data.title">
    <h2 class="title">{{ getGlobalTitle }}{{ data.title }}</h2>
    <div class="content" v-html="data.content"></div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      data: ''
    }
  },
  computed: {
    ...mapGetters({
      getGlobalTitle: 'projectSetting/getGlobTitle'
    })
  },
  created() {
    this.handleGetSingle()
  },
  methods: {
    handleGetSingle() {
      this.$api.getSingleFetch(
        {
          id: this.$route.query.id,
          type: this.$route.query.type
        },
        res => {
          this.data = res.data
        }
      )
    }
  }
}
</script>

<style lang="scss" scoped>
.single {
  margin-top: 10px;
  background-color: #fff;
  .title {
    margin: 0;
    height: 60px;
    line-height: 60px;
    padding: 0 15px;
    font-size: 22px;
    font-weight: 500;
    color: $text-color-import;
    border-bottom: 1px solid #f4f4f4;
  }
  .content {
    padding: 0 15px;
  }
}
</style>
